package com.bdqn.service;

import com.bdqn.mapper.UserMapper;
import com.bdqn.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService{

    @Resource
    UserMapper userMapper;


    /**
     * 根据用户名查找用户
     * @param username
     * @return
     */
    @Override
    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    /**
     * 修改用户密码
     * @param user
     * @return
     */
    @Override
    public int editPassword(User user) {
        return userMapper.editPassword(user);
    }

    public List<User> getList(Map<String, Object> queryMap) {
        return userMapper.getList(queryMap);
    }



    public int getTotal(Map<String, Object> queryMap) {
        return userMapper.getTotal(queryMap);
    }

    public int add(User user) {
        return userMapper.add(user);
    }

    public int edit(User user) {
        return userMapper.edit(user);
    }

    public int delete(String user) {
        return userMapper.delete(user);
    }
}
